package spm.entities;

/**
 * This is a persistent class used by Hibernate. The class represents a
 * privilege assigned to the role.
 * 
 * The privilege contains three objects:
 *  - the business object (e.g. Project, Task, Task Log etc) - the operation
 * (create, edit, delete, view) - the permission (allow, deny)
 * 
 * The combination of these three objects defined the access level.
 * 
 * For example,
 * 
 * Project/Create/Allow - the privilege gives the user the ability to create a
 * new project
 * 
 * Task/Edit/Deny - the user has no ability to edit any task object within the
 * project
 * 
 * @author Evgeny Ryzhkov
 * 
 * $Id: Privilege.java 11 2006-12-04 15:04:58Z evgeny.ryzhkov $
 */
public class Privilege {

	/**
	 * The business object to which the privilege is applyed.
	 */
	private BusinessObject businessObject;

	/**
	 * The operation on the business object.
	 */
	private Operation operation;

	/**
	 * The operation permission.
	 */
	private Permission permission;

	/**
	 * Constructor without parameters. It is required by Hibernate.
	 */
	public Privilege() {
	}

	/**
	 * @return Returns the businessObject.
	 */
	public BusinessObject getBusinessObject() {
		return businessObject;
	}

	/**
	 * @param businessObject
	 *            The businessObject to set.
	 */
	public void setBusinessObject(BusinessObject businessObject) {
		this.businessObject = businessObject;
	}

	/**
	 * @return Returns the operation.
	 */
	public Operation getOperation() {
		return operation;
	}

	/**
	 * @param operation
	 *            The operation to set.
	 */
	public void setOperation(Operation operation) {
		this.operation = operation;
	}

	/**
	 * @return Returns the permission.
	 */
	public Permission getPermission() {
		return permission;
	}

	/**
	 * @param permission
	 *            The permission to set.
	 */
	public void setPermission(Permission permission) {
		this.permission = permission;
	}

}
